package com.cskaoyan.wxcontroller;

import com.cskaoyan.bean.baseresultVO.BaseData;
import com.cskaoyan.bean.baseresultVO.BaseParam;
import com.cskaoyan.bean.baseresultVO.BaseRespVo;
import com.cskaoyan.bean.domain.Brand;
import com.cskaoyan.bean.domain.Category;
import com.cskaoyan.bean.wxcatalogs.WxCatalog.CatalogIndexVo;
import com.cskaoyan.service.BrandService;
import com.cskaoyan.service.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author looper
 * @ 类目控制器
 **/

@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    BrandService service;

    @GetMapping("detail")
    public BaseRespVo getDetail(Brand brand) {

        Brand brandDetail = service.getBrandDetail(brand.getId());

        return BaseRespVo.ok(brandDetail);
    }

    @GetMapping("list")
    public BaseRespVo getList(BaseParam baseParam) {

        BaseData baseData = service.getList(baseParam);

        return BaseRespVo.ok(baseData);
    }


}
